package com.example.demo.controller;

import org.springframework.cloud.context.restart.RestartEndpoint;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class RestartController {
    @Resource
    private RestartEndpoint restartEndpoint;

    @GetMapping("/restartApplication")
    public void restartApplication() {
        restartEndpoint.restart();
    }
}
